=begin
Other way of doing all of this is to have just a method that returns the next
Fibonacci number and use ``1.upto(ARGV.last.to_i)`` to control how many
Fibonacci numbers to create.
=end

def fibonacci(up_to)
    prev1, prev2 = 1, 0
    while up_to > 0
        up_to -= 1
        yield prev2
        prev1, prev2 = prev1+prev2, prev1
    end
end

if __FILE__ == $0
    fibonacci(ARGV.last.to_i + 1) {|fib| print "#{fib} "}
    puts '...'
end
